<?php

use yii\helpers\Url;

?>
<?= Yii::$app->view->renderFile('@app/modules/admin/views/common/tab_pro.php', ['tab' => 'index']) ?>
<div class="panel-content">
  <table class="ui selectable celled table">
    <input type="hidden" name="_csrf" id='csrf' value="<?= Yii::$app->request->csrfToken ?>">
    <thead>
    <tr>
      <th>项目名称</th>
      <th>项目封面图</th>
      <th>创建时间</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>

    <?php if ($list): ?>
      <?php foreach ($list as $item): ?>
        <tr>
          <td><?= $item['pro_title'] ?></td>
          <td><img src="<?= $item['cover_img'] ?>" alt="" style="display: block; height: 40px;width: 40px"></td>
          <td><?= date('Y-m-d', $item['create_time']) ?></td>
          <td>
            <a href="<?= Url::to(['/admin/project/set', 'id' => $item['id']]) ?>"><i
                      class="edit icon"></i></a>
            <a href="javascript:void (0)"><i class="trash alternate icon _del"
                                             data-id="<?= $item['id'] ?>"></i></a>
          </td>
        </tr>
      <?php endforeach; ?>
    <?php else: ?>
      <tr>
        <td colspan="4">暂无数据</td>
      </tr>
    <?php endif; ?>
    </tbody>

  </table>
</div>
<?= Yii::$app->view->renderFile('@app/modules/admin/views/common/page.php', ['total_page' => $total_page, 'p' => $p, 'url' => '/admin/goods/index']) ?>
<script type="text/javascript">
  require(['modules/project/index'], function (index) {
    index.pro_del()
  })
</script>
